import App from './App.vue';
import 'virtual:uno.css';
import './styles/global.scss';
import './styles/ui.scss';
import './styles/other.scss';
import { createApp } from 'vue';
import { router, setupRouter } from '@/router';
import { setupI18n } from '@/locales';
import { setupStore } from '@/stores';
import { setupMicro } from '@/micro'
import { useAppStore } from '@/stores/modules/app';
import VueDOMPurifyHTML from 'vue-dompurify-html';

async function bootstrap() {
	const app = createApp(App);

	// 配置 pinia-store
	await setupStore(app);

	// 配置 国际化 i18n
	await setupI18n(app, { defaultLocale: useAppStore().locale });

	// 配置微服务
	setupMicro(router)

	// 配置路由
	setupRouter(app);

	app.use(VueDOMPurifyHTML);

	// 挂载
	app.mount('#app');
}

bootstrap();
